#{extends "main.html" /}
#{set title:"SplitTemplate and Aircrafts Binding" /}

<div class="col-md-6">

#{form @Bind.submitTemplate()}

<div class="form-group">
    <label for="id">Split Template</label>
    <select class="form-control" name="id" id="id">
        <option value="0">Please select on template</option>
        <optgroup label="-">
            #{list items:allTemplates, as:"item" }
            %{
                curTemplateId = entity ? entity.getId() : null;
                if (item.getId() == curTemplateId) {
                }%
                <option value ="${item.getId()}" selected="1">${item.split_template_name}</option>
            %{
                } else {
                }%
                <option value ="${item.getId()}">${item.split_template_name}</option>
            %{
                }
                }%
            #{/list}
        </optgroup>
    </select>
</div>
<div class="form-group">
    <label for="prefix">Post with prefix</label>
    <input type="text" class="form-control" id="prefix" name="prefix" value="${prefix}" />
</div>

<div class="form-group">
    <label for="aircrafts">Aircarfts List</label>
    <textarea class="form-control" name="aircrafts" id="aircrafts">${ aircrafts}</textarea>
    <small class="form-text text-muted">Seperated by whitespace " " or comma "," or semicolon ";"</small>
</div>

<p>
<button type="submit" name="submit" class="btn btn-primary">Submit</button>
<button type="submit" name="verify" class="btn btn-secondary">Verify</button>
</p>
#{/form}

</div>